
#include "apue.h"

int main()
{
    int int1, int2;
    char line[MAXLINE] = {0};

    while (fgets(line, MAXLINE, stdin) != NULL)
    {
        if (2 == sscanf(line, "%d%d", &int1, &int2))
        {
            if (EOF == printf("%d\n", int1 + int2))
            {
                err_sys("printf error");
            }
        }
        else
        {
            if (EOF == printf("invalid args\n"))
            {
                err_sys("printf error");
            }
        }
    }

    exit(0);
}
